#include<bits/stdc++.h>
using namespace std;
#include<stack>
struct Link{
	char ch;
	struct Link *next;
};
typedef Link *List;
int main(){
	char a[27],b[27];
	string c[100]; 
	stack<char> s;
	List L,p,q;
	L=new Link;
	q=L;
	int item=0,flag=0,i,j,k=0;
	gets(a);
	for(i=0;a[i];i++){
		p=new Link;
		p->ch=a[i];
		q->next=p;
		q=p;
	}
	q->next=NULL;
	q=L;
	gets(b);
	for(i=0;b[i];i++){
		flag=0;
		while(!s.empty()&&s.top()==b[i]){
			c[k]="3->2";
			k++;
			s.pop();
			i++;
		}
		if(b[i]=='\0') break;
		for(p=L->next;p;q=p,p=p->next){
			if(p->ch!=b[i]){
				c[k]="1->3";
				k++;
				s.push(p->ch);
				q->next=p->next;
				delete p;
				p=q;
			}
			else if(p->ch==b[i]){
				c[k]="1->2";
				k++;
				q->next=p->next;
				delete p;
				p=q;
				flag=1;
				break;
			}
		}
		if(flag==0&&s.top()!=b[i]) break;
	}
	c[k]="end";
	if(flag==0&&!s.empty()) cout<<"Are you kidding me?";
	else {
		for(i=0;c[i]!="end";i++){
			cout<<c[i]<<endl;
		}
	}
	return 0;
}
